/** * Returns an interned string equal to this string. The VM maintains an internal set of * unique strings. All string literals found in loaded classes' * constant pools are automatically interned. Manually-interned strings are only weakly * referenced, so calling {@code intern} won't lead to unwanted retention. * * <p>Interning is typically used because it guarantees that for interned strings * {@code a} and {@code b}, {@code a.equals(b)} can be simplified to * {@code a == b}. (This is not true of non-interned strings.) * * <p>Many applications find it simpler and more convenient to use an explicit * {@link java.util.HashMap} to implement their own pools. */ publicnative String intern();